#include "LoginWindow.h"
#include <QLabel>
#include <QGridLayout>


LoginWindow::LoginWindow(QWidget *parent): QWidget(parent)
{
    loginTxt = new QLineEdit(this);
    passwordTxt = new QLineEdit(this);
    passwordTxt->setEchoMode(QLineEdit::Password);
    QLabel * loginLbl = new QLabel("Login:",this);
    QLabel * passwordLbl = new QLabel("Password:",this);
    QGridLayout * mainLayout = new QGridLayout;

    mainLayout->addWidget(loginLbl, 0, 0);
    mainLayout->addWidget(passwordLbl,1,0);
    mainLayout->addWidget(loginTxt,0,1);
    mainLayout->addWidget(passwordTxt,1,1);

    setLayout(mainLayout);


    connect(passwordTxt, SIGNAL(returnPressed()),
            this, SLOT(onEnterButton())
           );
}

QString LoginWindow::getLogin()
{
    return login;
}

QString LoginWindow::getPassword()
{
    return password;
}

void LoginWindow::setLogin()
{
    login = loginTxt->text();
}

void LoginWindow::setPassword()
{
    password = passwordTxt->text();
}
